package com.infore.siteManagement.controller.equipment;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.infore.siteManagement.service.equipment.IEquipLogService;
import com.infore.siteManagement.util.PageObject;
import com.infore.siteManagement.util.ResultEntity;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@Api(value = "仪器密码日志管理接口", tags = { "仪器密码日志管理接口" })
@RestController
@RequestMapping("/equipLog")
public class EquipLogController {

	@Autowired
	private IEquipLogService iEquipLogService;

	@ApiOperation(value = "查询仪器密码日志接口")
	@ResponseBody
	@ApiImplicitParams({
			@ApiImplicitParam(value = "开始时间", name = "startTime", paramType = "query", required = false, dataType = "String"),
			@ApiImplicitParam(value = "结束时间", name = "endTime", paramType = "query", required = false, dataType = "String"),
			@ApiImplicitParam(value = "运营中心id", name = "opcenId", paramType = "query", required = false, dataType = "String"),
			@ApiImplicitParam(value = "设备型号", name = "equipModelId", paramType = "query", required = false, dataType = "String"),
			@ApiImplicitParam(value = "人员名", name = "userName", paramType = "query", required = false, dataType = "String") })
	@GetMapping(value = "/query")
	public ResultEntity query(String startTime, String endTime, String opcenId, String equipModelId,
			String userName,PageObject pageObject) {
		return iEquipLogService.query(startTime, endTime, opcenId, equipModelId, userName,pageObject);
	}

	@ApiOperation(value = "删除仪器密码日志接口")
	@ApiImplicitParams(@ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true, dataType = "String"))
	@DeleteMapping(value = "/delete")
	public ResultEntity delete(String id) {
		return iEquipLogService.delete(id);
	}
}
